#!/bin/sh
# 02sh编译脚本ubuntu

#### prj_test reUpdate ================ 
# cd /mnt/wml/ftpdir/sh/ && ./0build_prj_test_sh

rebuildPrj()
{
	cd /home/wml/prj/
	rm -R prj_test
	svn co svn://192.168.17.210/Ipphone/branches/prj_test
	cd /home/wml/prj/prj_test/
	svn up
	chmod 777 -R ../prj_test/
	. ./build.sh TCL
	rm /mnt/wml/ftpdir/V*.jffs2
	cd /home/wml/prj/prj_test/dvf99/images
	cp V*.jffs2        /mnt/wml/ftpdir
	echo rebuild finished.
	
}

cd /home/wml/prj/
local_version=$(svn info prj_test|grep Revision|cut -c 11-)
svn_version=$(svn list -v svn://192.168.17.210/Ipphone/branches/prj_test |sed -n '1p' |awk '{print $1}')
echo local=$local_version, svn=$svn_version
if [ $svn_version -gt $local_version ]; then
	echo need rebuild.
	rebuildPrj
else
	echo not need rebuild. local=$local_version,svn=$svn_version 
fi


